package leetcode.weekly.week312;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

//Solution1Test
public class Solution1 {
	public String[] sortPeople(String[] names, int[] heights) {
		int len = heights.length;
		int[][] info = new int[len][2];
		for (int i = 0; i < info.length; i++) {
			info[i][0] = heights[i];
			info[i][1] = i;
		}
		Arrays.sort(info, (a, b) -> b[0] - a[0]);
		String[] ans = new String[len];
		for (int i = 0; i < ans.length; i++) {
			ans[i]=names[info[i][1]];
		}
		return ans;
	}

}
